package com.example.studentknowledgesys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author 光的代言人
 */
@Controller
public class AdminController {
    @GetMapping({"/", "/dashboard"})
    public String dashboard(Model model) {
        model.addAttribute("pageTitle", "仪表盘");
        return "/admin/dashboard";
    }

    @GetMapping("/articles")
    public String articles(Model model) {
        model.addAttribute("pageTitle", "文章管理");
        return "/admin/articles";
    }

    @GetMapping("/users")
    public String users(Model model) {
        model.addAttribute("pageTitle", "用户管理");
        return "/admin/users";
    }

    @GetMapping("/files")
    public String files(Model model) {
        model.addAttribute("pageTitle", "文件管理");
        return "/admin/files";
    }

    @GetMapping("/points")
    public String points(Model model) {
        model.addAttribute("pageTitle", "积分管理");
        return "/admin/points";
    }

    @GetMapping("/settings")
    public String settings(Model model) {
        model.addAttribute("pageTitle", "系统设置");
        return "/admin/settings";
    }
}
